package com.ygp.jmm.visible;


//import com.ygp.utils.Sleeper;
//import lombok.extern.slf4j.Slf4j;

//@Slf4j(topic = "c.Visible")
public class Visible2 {
    static boolean runCondition = true;
    final static Object obj = new Object();
    public static void main(String[] args) {
        Thread t = new Thread(() -> {
            while (true) {
                synchronized (obj){
                    if (!runCondition) {
                        break;
                    }
                }
            }
        });
        t.start();
//        Sleeper.sleep(1);
        synchronized (obj){
            runCondition = false;
        }
    }
}
